package com.ying.po.order;


import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel("橙子信息")
@Entity
@Table(name = "t_orange")
@DynamicInsert
@DynamicUpdate
public class Orange implements Serializable {

    @ApiModelProperty(value = "主键", example = "1")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @ApiModelProperty(value = "橙子价格")
    @Column(name = "price")
    private BigDecimal price;

    @ApiModelProperty(value = "橙子品类")
    @Column(name = "description")
    private String description;

    @ApiModelProperty(value = "某年橙子")
    @Column(name = "year")
    @JsonFormat(pattern= "yyyy")
    private Date year;

    @ApiModelProperty(value = "是否删除")
    @Column(name = "is_delete")
    private Integer isDelete;

    @ApiModelProperty(value = "系统用户ID")
    @Column(name = "user_id")
    private Integer userId;

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Date getYear() {
        return year;
    }

    public void setYear(Date year) {
        this.year = year;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    @Override
    public String toString() {
        return "Orange{" +
                "id=" + id +
                ", price=" + price +
                ", description='" + description + '\'' +
                ", year=" + year +
                ", isDelete=" + isDelete +
                ", userId=" + userId +
                '}';
    }
}
